var emId;
window.onload = function (){
    emId = getQuery("id");
    findById();
}

function findById(){
    axios.get("/em/findById",{
        params:{
            id:emId
        }
    }).then(resp =>{
       var info = resp.data;
       $("nameSpan").innerHTML = info.name;
       $("phoneSpan").innerHTML = info.phone;
       $("moneyTxt").value = info.money;
       $("faceImg").src = "/emFace/"+info.imgPath;
    });
}

function update(){
    axios.get("/em/update",{
        params: {
            id:emId,
            money:$("moneyTxt").value
        }
    }).then(resp =>{
        if(resp.data == "ok"){
            location.href = "/main.html";
        }
    })
}